<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return=array();
	exi($return);
}
if($_RQ['op']=='gettanmus'){
	$params=array('uniacid'=>$_SESSION['uniacid'],'deleted'=>0);
	$pindex = max(1, intval($_RQ['page']));
	$psize = 30;
	$total='';
	$fields=array('id','mid','status');
	$list=pdo_getslice('jy_creditshop_log',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
	$params=array('uniacid'=>$_SESSION['uniacid'],'is_virtual'=>1,'avatar <>'=>'');
	$virtuals=pdo_getall('core_members',$params,array('id','avatar','nickname'));
	$virtuals=array_values($virtuals);
	$num=count($virtuals);
	foreach($list as &$item){
		$member=cfc('core')->member_show($item['mid']);
		if(!$member['avatar'] && $return['pluginset']['is_virtual']){
			$key=mt_rand(0,$num);
			$member['avatar']=$virtuals[$key]['avatar'];
			$member['nickname']=$virtuals[$key]['nickname'];
		}else{
			$member['avatar']=$member['avatar']?:'../core/resource/images/nopic.jpg';
		}
		$member['nickname']=mb_substr($member['nickname'],0,4,'utf-8').'***';
		$item['nickname']=$member['nickname'];
		$item['avatar']=tomedia($member['avatar']);
	}
	$return['list']=$list;
	exi($return);
}
?>